package com.md.infrastructure.persistence.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.md.base.BaseRepositoryImpl;
import com.md.domain.model.po.UsersRolePO;
import com.md.domain.repository.UsersRoleRepository;
import com.md.infrastructure.persistence.mapper.UsersRoleMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 刘骄阳
 * 2022-06-12 1:22
 */
@Repository
public class DAOUsersRoleRepository extends BaseRepositoryImpl<UsersRolePO, UsersRoleMapper>
  implements UsersRoleRepository {
  public DAOUsersRoleRepository(final UsersRoleMapper mapper) {
    super(mapper);
  }

  @Override
  public List<UsersRolePO> selectUserRole(final Long userId) {
    return mapper.selectList(new LambdaQueryWrapper<UsersRolePO>().eq(UsersRolePO::getUserId, userId));
  }
}
